<template>
  <div>
    <div class="mian">
      <div class="titel">
        <h3 class="tit"> {{title}}</h3>
        <div>
          <img :src="cover.images[0]" alt="" class="thumb" v-if="cover.type===1">
        </div>
      </div>
      <div class="tupian" v-if="cover.type===3">
        <img :src="cover.images[0]" alt="" class="thumb">
        <img :src="cover.images[1]" alt="" class="thumb">
        <img :src="cover.images[2]" alt="" class="thumb">
      </div>
      <div class="foot">
        <span>作者 {{author}} &nbsp;&nbsp; {{cmtCount}} 评论 &nbsp; &nbsp;发布日期{{dat}} </span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'ArticleInfo',
  props: {
    // 标题
    title: {
      type: String,
      default: ''
    },
    // 作者
    author: {
      type: String,
      default: ''
    },
    // 评论数
    cmtCount: {
      type: [Number, String],
      default: ''
    },
    // 日期
    dat: {
      type: String,
      default: ''
    },
    // 图片
    cover: {
      type: Object,
      default: function () {
        return { cover: 0 }
      }
    }
  }
}
</script>

<style lang="less" scoped>
.mian {
  .titel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    .tit {
      flex: 2;
      font-size: 18px;
      font-weight: 500;
    }
    .thumb {
      flex: 1;
    }
  }
  .foot {
    margin-top: 5px;
    font-size: 14px;
    color: #bbb;
    text-indent: 1em;
  }
}
.tupian {
  display: flex;
  .thumb {
    flex: 1;
  }
}
.thumb {
  width: 113px;
  height: 70px;
  background-color: #f8f8f8;
  object-fit: cover;
}
</style>